package com.neusoft.neu.fy25g01.n98.controller;


import com.neusoft.neu.fy25g01.n98.entity.CommonResult;
import com.neusoft.neu.fy25g01.n98.entity.Person;
import com.neusoft.neu.fy25g01.n98.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sys/p")
@CrossOrigin
public class PersonController {
    @Autowired
    private PersonService personService;

    @GetMapping("/find/by/null")
    public CommonResult<List<Person>> findAll() {
        return personService.findAll();
    }

    @PutMapping("/mod")
    public CommonResult modPerson(@RequestBody Person person) {
        return personService.modPerson(person);
    }

}
